Integrand size = 16, antiderivative size = 138 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {24 b^2 \cos (c+d x)}{d^5}+\frac {4 a b \cos (c+d x)}{d^3}-\frac {a^2 \cos (c+d x)}{d}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}-\frac {24 b^2 x \sin (c+d x)}{d^4}+\frac {4 a b x \sin (c+d x)}{d^2}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2} \]
-24*b^2*cos(d*x+c)/d^5+4*a*b*cos(d*x+c)/d^3-a^2*cos(d*x+c)/d+12*b^2*x^2*co s(d*x+c)/d^3-2*a*b*x^2*cos(d*x+c)/d-b^2*x^4*cos(d*x+c)/d-24*b^2*x*sin(d*x+ c)/d^4+4*a*b*x*sin(d*x+c)/d^2+4*b^2*x^3*sin(d*x+c)/d^2
Time = 0.12 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.62 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=\frac {-\left (\left (a^2 d^4+2 a b d^2 \left (-2+d^2 x^2\right )+b^2 \left (24-12 d^2 x^2+d^4 x^4\right )\right ) \cos (c+d x)\right )+4 b d x \left (a d^2+b \left (-6+d^2 x^2\right )\right ) \sin (c+d x)}{d^5} \]
(-((a^2*d^4 + 2*a*b*d^2*(-2 + d^2*x^2) + b^2*(24 - 12*d^2*x^2 + d^4*x^4))* Cos[c + d*x]) + 4*b*d*x*(a*d^2 + b*(-6 + d^2*x^2))*Sin[c + d*x])/d^5
Time = 0.33 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3810, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx\) |
\(\Big \downarrow \) 3810 |
\(\displaystyle \int \left (a^2 \sin (c+d x)+2 a b x^2 \sin (c+d x)+b^2 x^4 \sin (c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {a^2 \cos (c+d x)}{d}+\frac {4 a b \cos (c+d x)}{d^3}+\frac {4 a b x \sin (c+d x)}{d^2}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {24 b^2 \cos (c+d x)}{d^5}-\frac {24 b^2 x \sin (c+d x)}{d^4}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2}-\frac {b^2 x^4 \cos (c+d x)}{d}\) |
(-24*b^2*Cos[c + d*x])/d^5 + (4*a*b*Cos[c + d*x])/d^3 - (a^2*Cos[c + d*x]) /d + (12*b^2*x^2*Cos[c + d*x])/d^3 - (2*a*b*x^2*Cos[c + d*x])/d - (b^2*x^4 *Cos[c + d*x])/d - (24*b^2*x*Sin[c + d*x])/d^4 + (4*a*b*x*Sin[c + d*x])/d^ 2 + (4*b^2*x^3*Sin[c + d*x])/d^2
3.1.51.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*Sin[(c_.) + (d_.)*(x_)], x_Symbol] :> In t[ExpandIntegrand[Sin[c + d*x], (a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, n}, x] && IGtQ[p, 0]
Time = 0.25 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.68
method | result | size |
risch | \(-\frac {\left (b^{2} x^{4} d^{4}+2 a b \,d^{4} x^{2}+a^{2} d^{4}-12 d^{2} x^{2} b^{2}-4 a b \,d^{2}+24 b^{2}\right ) \cos \left (d x +c \right )}{d^{5}}+\frac {4 b x \left (d^{2} x^{2} b +a \,d^{2}-6 b \right ) \sin \left (d x +c \right )}{d^{4}}\) | \(94\) |
parallelrisch | \(\frac {2 x^{2} d^{2} \left (\left (\frac {b \,x^{2}}{2}+a \right ) d^{2}-6 b \right ) b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \left (\left (b \,x^{2}+a \right ) d^{2}-6 b \right ) x d b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-b^{2} x^{4}-2 a b \,x^{2}-2 a^{2}\right ) d^{4}+\left (12 x^{2} b^{2}+8 a b \right ) d^{2}-48 b^{2}}{d^{5} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\) | \(133\) |
norman | \(\frac {\frac {b^{2} x^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a^{2} d^{4}-8 a b \,d^{2}+48 b^{2}}{d^{5}}-\frac {b^{2} x^{4}}{d}+\frac {8 b^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{2}}-\frac {2 b \left (a \,d^{2}-6 b \right ) x^{2}}{d^{3}}+\frac {8 b \left (a \,d^{2}-6 b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{4}}+\frac {2 b \left (a \,d^{2}-6 b \right ) x^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d^{3}}}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\) | \(168\) |
parts | \(-\frac {b^{2} x^{4} \cos \left (d x +c \right )}{d}-\frac {2 a b \,x^{2} \cos \left (d x +c \right )}{d}-\frac {a^{2} \cos \left (d x +c \right )}{d}+\frac {4 b \left (-a c \sin \left (d x +c \right )+a \left (\cos \left (d x +c \right )+\left (d x +c \right ) \sin \left (d x +c \right )\right )-\frac {b \,c^{3} \sin \left (d x +c \right )}{d^{2}}+\frac {3 b \,c^{2} \left (\cos \left (d x +c \right )+\left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}-\frac {3 b c \left (\left (d x +c \right )^{2} \sin \left (d x +c \right )-2 \sin \left (d x +c \right )+2 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {b \left (\left (d x +c \right )^{3} \sin \left (d x +c \right )+3 \left (d x +c \right )^{2} \cos \left (d x +c \right )-6 \cos \left (d x +c \right )-6 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}\right )}{d^{3}}\) | \(229\) |
meijerg | \(\frac {16 b^{2} \sqrt {\pi }\, \sin \left (c \right ) \left (-\frac {x \left (d^{2}\right )^{\frac {5}{2}} \left (-\frac {5 d^{2} x^{2}}{2}+15\right ) \cos \left (d x \right )}{10 \sqrt {\pi }\, d^{4}}+\frac {\left (d^{2}\right )^{\frac {5}{2}} \left (\frac {5}{8} d^{4} x^{4}-\frac {15}{2} d^{2} x^{2}+15\right ) \sin \left (d x \right )}{10 \sqrt {\pi }\, d^{5}}\right )}{d^{4} \sqrt {d^{2}}}+\frac {16 b^{2} \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {3}{2 \sqrt {\pi }}-\frac {\left (\frac {3}{8} d^{4} x^{4}-\frac {9}{2} d^{2} x^{2}+9\right ) \cos \left (d x \right )}{6 \sqrt {\pi }}-\frac {d x \left (-\frac {3 d^{2} x^{2}}{2}+9\right ) \sin \left (d x \right )}{6 \sqrt {\pi }}\right )}{d^{5}}+\frac {8 b a \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {x \left (d^{2}\right )^{\frac {3}{2}} \cos \left (d x \right )}{2 \sqrt {\pi }\, d^{2}}-\frac {\left (d^{2}\right )^{\frac {3}{2}} \left (-\frac {3 d^{2} x^{2}}{2}+3\right ) \sin \left (d x \right )}{6 \sqrt {\pi }\, d^{3}}\right )}{d^{2} \sqrt {d^{2}}}+\frac {8 b a \sqrt {\pi }\, \cos \left (c \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (-\frac {d^{2} x^{2}}{2}+1\right ) \cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {d x \sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{3}}+\frac {a^{2} \sin \left (c \right ) \sin \left (d x \right )}{d}+\frac {a^{2} \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (d x \right )}{\sqrt {\pi }}\right )}{d}\) | \(300\) |
derivativedivides | \(\frac {-a^{2} \cos \left (d x +c \right )-\frac {2 a b \,c^{2} \cos \left (d x +c \right )}{d^{2}}-\frac {4 a b c \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {2 a b \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}-\frac {b^{2} c^{4} \cos \left (d x +c \right )}{d^{4}}-\frac {4 b^{2} c^{3} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {6 b^{2} c^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {b^{2} \left (-\left (d x +c \right )^{4} \cos \left (d x +c \right )+4 \left (d x +c \right )^{3} \sin \left (d x +c \right )+12 \left (d x +c \right )^{2} \cos \left (d x +c \right )-24 \cos \left (d x +c \right )-24 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}}{d}\) | \(336\) |
default | \(\frac {-a^{2} \cos \left (d x +c \right )-\frac {2 a b \,c^{2} \cos \left (d x +c \right )}{d^{2}}-\frac {4 a b c \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {2 a b \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}-\frac {b^{2} c^{4} \cos \left (d x +c \right )}{d^{4}}-\frac {4 b^{2} c^{3} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {6 b^{2} c^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {b^{2} \left (-\left (d x +c \right )^{4} \cos \left (d x +c \right )+4 \left (d x +c \right )^{3} \sin \left (d x +c \right )+12 \left (d x +c \right )^{2} \cos \left (d x +c \right )-24 \cos \left (d x +c \right )-24 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}}{d}\) | \(336\) |
-(b^2*d^4*x^4+2*a*b*d^4*x^2+a^2*d^4-12*b^2*d^2*x^2-4*a*b*d^2+24*b^2)/d^5*c os(d*x+c)+4*b*x/d^4*(b*d^2*x^2+a*d^2-6*b)*sin(d*x+c)
Time = 0.27 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.70 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {{\left (b^{2} d^{4} x^{4} + a^{2} d^{4} - 4 \, a b d^{2} + 2 \, {\left (a b d^{4} - 6 \, b^{2} d^{2}\right )} x^{2} + 24 \, b^{2}\right )} \cos \left (d x + c\right ) - 4 \, {\left (b^{2} d^{3} x^{3} + {\left (a b d^{3} - 6 \, b^{2} d\right )} x\right )} \sin \left (d x + c\right )}{d^{5}} \]
-((b^2*d^4*x^4 + a^2*d^4 - 4*a*b*d^2 + 2*(a*b*d^4 - 6*b^2*d^2)*x^2 + 24*b^ 2)*cos(d*x + c) - 4*(b^2*d^3*x^3 + (a*b*d^3 - 6*b^2*d)*x)*sin(d*x + c))/d^ 5
Time = 0.33 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.25 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=\begin {cases} - \frac {a^{2} \cos {\left (c + d x \right )}}{d} - \frac {2 a b x^{2} \cos {\left (c + d x \right )}}{d} + \frac {4 a b x \sin {\left (c + d x \right )}}{d^{2}} + \frac {4 a b \cos {\left (c + d x \right )}}{d^{3}} - \frac {b^{2} x^{4} \cos {\left (c + d x \right )}}{d} + \frac {4 b^{2} x^{3} \sin {\left (c + d x \right )}}{d^{2}} + \frac {12 b^{2} x^{2} \cos {\left (c + d x \right )}}{d^{3}} - \frac {24 b^{2} x \sin {\left (c + d x \right )}}{d^{4}} - \frac {24 b^{2} \cos {\left (c + d x \right )}}{d^{5}} & \text {for}\: d \neq 0 \\\left (a^{2} x + \frac {2 a b x^{3}}{3} + \frac {b^{2} x^{5}}{5}\right ) \sin {\left (c \right )} & \text {otherwise} \end {cases} \]
Piecewise((-a**2*cos(c + d*x)/d - 2*a*b*x**2*cos(c + d*x)/d + 4*a*b*x*sin( c + d*x)/d**2 + 4*a*b*cos(c + d*x)/d**3 - b**2*x**4*cos(c + d*x)/d + 4*b** 2*x**3*sin(c + d*x)/d**2 + 12*b**2*x**2*cos(c + d*x)/d**3 - 24*b**2*x*sin( c + d*x)/d**4 - 24*b**2*cos(c + d*x)/d**5, Ne(d, 0)), ((a**2*x + 2*a*b*x** 3/3 + b**2*x**5/5)*sin(c), True))
Leaf count of result is larger than twice the leaf count of optimal. 292 vs. \(2 (138) = 276\).
Time = 0.19 (sec) , antiderivative size = 292, normalized size of antiderivative = 2.12 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {a^{2} \cos \left (d x + c\right ) + \frac {b^{2} c^{4} \cos \left (d x + c\right )}{d^{4}} + \frac {2 \, a b c^{2} \cos \left (d x + c\right )}{d^{2}} - \frac {4 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b^{2} c^{3}}{d^{4}} - \frac {4 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a b c}{d^{2}} + \frac {6 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} b^{2} c^{2}}{d^{4}} + \frac {2 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} a b}{d^{2}} - \frac {4 \, {\left ({\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \cos \left (d x + c\right ) - 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \sin \left (d x + c\right )\right )} b^{2} c}{d^{4}} + \frac {{\left ({\left ({\left (d x + c\right )}^{4} - 12 \, {\left (d x + c\right )}^{2} + 24\right )} \cos \left (d x + c\right ) - 4 \, {\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \sin \left (d x + c\right )\right )} b^{2}}{d^{4}}}{d} \]
-(a^2*cos(d*x + c) + b^2*c^4*cos(d*x + c)/d^4 + 2*a*b*c^2*cos(d*x + c)/d^2 - 4*((d*x + c)*cos(d*x + c) - sin(d*x + c))*b^2*c^3/d^4 - 4*((d*x + c)*co s(d*x + c) - sin(d*x + c))*a*b*c/d^2 + 6*(((d*x + c)^2 - 2)*cos(d*x + c) - 2*(d*x + c)*sin(d*x + c))*b^2*c^2/d^4 + 2*(((d*x + c)^2 - 2)*cos(d*x + c) - 2*(d*x + c)*sin(d*x + c))*a*b/d^2 - 4*(((d*x + c)^3 - 6*d*x - 6*c)*cos( d*x + c) - 3*((d*x + c)^2 - 2)*sin(d*x + c))*b^2*c/d^4 + (((d*x + c)^4 - 1 2*(d*x + c)^2 + 24)*cos(d*x + c) - 4*((d*x + c)^3 - 6*d*x - 6*c)*sin(d*x + c))*b^2/d^4)/d
Time = 0.29 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.72 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {{\left (b^{2} d^{4} x^{4} + 2 \, a b d^{4} x^{2} + a^{2} d^{4} - 12 \, b^{2} d^{2} x^{2} - 4 \, a b d^{2} + 24 \, b^{2}\right )} \cos \left (d x + c\right )}{d^{5}} + \frac {4 \, {\left (b^{2} d^{3} x^{3} + a b d^{3} x - 6 \, b^{2} d x\right )} \sin \left (d x + c\right )}{d^{5}} \]
-(b^2*d^4*x^4 + 2*a*b*d^4*x^2 + a^2*d^4 - 12*b^2*d^2*x^2 - 4*a*b*d^2 + 24* b^2)*cos(d*x + c)/d^5 + 4*(b^2*d^3*x^3 + a*b*d^3*x - 6*b^2*d*x)*sin(d*x + c)/d^5
Time = 6.26 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.86 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=\frac {4\,b^2\,x^3\,\sin \left (c+d\,x\right )}{d^2}-\frac {b^2\,x^4\,\cos \left (c+d\,x\right )}{d}-\frac {\cos \left (c+d\,x\right )\,\left (a^2\,d^4-4\,a\,b\,d^2+24\,b^2\right )}{d^5}-\frac {4\,x\,\sin \left (c+d\,x\right )\,\left (6\,b^2-a\,b\,d^2\right )}{d^4}+\frac {2\,x^2\,\cos \left (c+d\,x\right )\,\left (6\,b^2-a\,b\,d^2\right )}{d^3} \]